<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>横向jquery实现伸缩菜单</title>
    <style type="text/css">
        /*初始化*/
        * {
            margin: 0;
            padding: 0;
            font-size: 14px;
        }

        ul {
            list-style: none;
            height: 50px;
            padding-left: 30px;
            border-bottom: 5px solid #f60;
        }

        li {
            float: left;
            margin-top: 20px;
        }

        li a {
            text-align: center;
            text-decoration: none;
            display: block;
            width: 120px;
            height: 30px;
            align: center;
            line-height: 30px;
            color: #000;
            background: #efefef;

        }

        li .on, a:hover {
            background: #f60;
            color: #ffffff;
        }
    </style>
    <script type="text/javascript" src="../jd/js/jquery-2.1.4.min.js"></script>
    <script>
        $(function () {
            $('a').hover(
                function () {
                    $(this).stop().animate({"width": "160px"}, 200);
                },
                function () {
                    $(this).stop().animate({"width": "120px"}, 200);
                }
                );
        });
    </script>
</head>
<body>
<div>
    <ul>
        <li><a class="on" href="#">首 页</a></li>
        <li><a href="#">新闻资讯</a></li>
        <li><a href="#">产品介绍</a></li>
        <li><a href="#">客户案例</a></li>
        <li><a href="#">联系我们</a></li>
    </ul>
</div>
</body>
</html>